﻿using UtilZ.Dotnet.Ex.Communication.Base;

namespace UtilZ.Dotnet.Ex.Communication.Ports
{
    /// <summary>
    /// 串口工厂接口
    /// </summary>
    public interface ISerialPortFactory
    {
        /// <summary>
        /// 获取当前计算机串口名数组
        /// </summary>
        /// <returns>当前计算机串口名数组</returns>
        string[] GetPortNames();

        /// <summary>
        /// 创建串口
        /// </summary>
        /// <param name="initPara">初始化参数</param>
        /// <returns>串口对象</returns>
        ISerialPort CreateSerialPort(IClientInitPara initPara);
    }
}
